<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head></head>
<body><h2 class="Welcome">Using NFSv4 referrals with NFS-GANESHA</h2>NFSv4
referral is a NFSv4 specific mechanism that makes it possible for a
server to redirect a client to another another as it crosses <br>a
directory. This is no "mount points within mount points" as you can
make in NFSv3, the client is actually redirected to the new server and
stop accessing the first one.<br><br>A small example: let be server A
and server B, and imagine that B's IP address is 123.456.789.123 (OK,
this is a dumb address, but this is an example). The client will access
A, find a referral a be redirected to B.<br><br>B exports directories
/export and /export/refer that are nfs-exported. From the mount point,
this last directory is accessed as path <span style="font-style: italic;">(moutpoint)/refer </span><br><br>The
server A exports /home . In A's namespace, we create a directory
/home/ref/nfs_referral to be used a referral. We'll then setup
nfs-ganesha so that, when directory nfs_referral is traversed, the
client is directed to A:/refer transparently.<br><br>In nfs-ganesha's configuration file on server A, you must defined two different 'Export' block.<br><br>The first one in related to /home, it should contain this:<br><div style="margin-left: 40px;">EXPORT<br>{<br><br>&nbsp; # Export Id (mandatory)<br>&nbsp; Export_Id = 1 ;<br><br>&nbsp; # Exported path (mandatory)<br>&nbsp; Path = "/home" ;<br><br>&nbsp;# Pseudo path for NFSv4 export (mandatory)<br>&nbsp; Pseudo = "/posix_fs";<br><br>(...)<br><br>}</div><br>Then we define a new Export block to setup the referral.<br><div style="margin-left: 40px;">EXPORT<br>{<br><br>&nbsp; # Export Id (mandatory)<br>&nbsp; Export_Id = 2 ;<br><br>&nbsp; # Exported path (mandatory)<br>&nbsp; Path = "/home/ref/nfs_referral" ;<br><span style="font-weight: bold;">&nbsp; Referral = "/posix_fs/nfs_referral:/refer@123.456.789.123" ;</span><br>(...)<br>}</div><br>The argument <span style="font-style: italic;">Referral</span> is to be explained a little bit. Its content is made of 3 part : (local pseudofs path):(remote path)@(server)<br><ul><li>the
'local pseudofs path' is the full path to the referral directory in
server A pseudofs, you have to consider the value of 'Pseudo' is the
first Export block (or do 'mount -t nfs4 A:/ /mnt' do get the path to
use)</li><li>the remote path is the path on B for the referral</li><li>the
last part should contain the server IP address. The server hostname
could be used as well, but at the time I am writting this, it seems
like the NFSv4 client in the kernel as problems in resolving hostname,
so the explicit use of the IP address is preferable.</li></ul><br><br></body></html>